<?php
namespace Dashboard\Model;
use Think\Model;
class AdminModel extends Model{
    protected $trueTableName = '';
    protected $_validate = array(
        //array(验证字段1,验证规则,错误提示,[验证条件,附加规则,验证时间]),
        array("name","require","用户名不能为空!"),
        array("numbers","require","账号不能为空!"),
        array('numbers','','账号已存在，请勿重复添加！',0,'unique',1),
        array("password","require","密码不能为空!"),
        array('password','6,100','密码长度必须大于等于等于6位',self::MUST_VALIDATE,'length',self::MODEL_INSERT),



        /*array("userpwd","require","密码不能为空!"),
        array("userpwd1","require","确认密码不能为空!"),
        array("userpwd1","userpwd","两次输入的密码不一致",0,"confirm"), // 验证确认密码是否和密码一致
        array("Email","email","邮箱格式不正确"),
        array('phone',"/^1[3|4|5|8][0-9]\d{4,8}$/",'请输入正确的手机号！'),
        array("ver","require","验证码不能为空")*/
    );
    protected $_auto = array (
        // 对password字段在所有情况下使用md5函数处理
        /*array('password','md5',3,'function'),
        // 对regdate字段在新增时写入当前时间戳
        array('create_at','time',1,'function'),*/
    );
}